﻿@model IEnumerable<IRIS.Models.Link>

@{
    ViewBag.Title = "List";
}

<h2>List</h2>

<p>
    @Html.ActionLink("Create New", "Create")
</p>
<table>
    <tr>
        <th>
            Title
        </th>
        <th>
            URL
        </th>
        <th>
            Description
        </th>
        @if (User.IsInRole("Stjórnendur"))
        {
        <th></th>}
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.Title)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.URL)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Description)
        </td>
        @if (User.IsInRole("Stjórnendur"))
        {
        <td>
            @Html.ActionLink("Breyta/Eyða", "Edit", new { id = item.ID })
        </td>}
    </tr>
}

</table>
